<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Page Content Above')){?>
            <!--  <div class="allinone"> </div> all in one #end --> 
        <?php } else {?>  <?php }?>


<!-- contact -->
<?php
if($_POST)
{
	if($_POST['your-email'])
	{
		$toEmailName = get_option('blogname');
		
		if(get_option('pttheme_contact_email')!="")
		$toEmail = get_option('pttheme_contact_email');
		else
		$toEmail = get_site_emailId();
		
		$subject = $_POST['your-subject'];
		$message = '';
		$message .= '<p>Dear '.$toEmailName.',</p>';
		$message .= '<p>Name : '.$_POST['your-name'].',</p>';
		$message .= '<p>Email : '.$_POST['your-email'].',</p>';
		$message .= '<p>Message : '.nl2br($_POST['your-message']).'</p>';
		$headers  = 'MIME-Version: 1.0' . "\r\n";
		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
		// Additional headers
		$headers .= 'To: '.$toEmailName.' <'.$toEmail.'>' . "\r\n";
		$headers .= 'From: '.$_POST['your-name'].' <'.$_POST['your-email'].'>' . "\r\n";
		
		// Mail it
		wp_mail($toEmail, $subject, $message, $headers);
		if(strstr($_REQUEST['request_url'],'?'))
		{
			$url =  $_REQUEST['request_url'].'&msg=success'	;	
		}else
		{
			$url =  $_REQUEST['request_url'].'?msg=success'	;
		}
		echo "<script type='text/javascript'>location.href='".$url."';</script>";
	}
}
?>
<?php global $is_home; ?>
        

     <?php if ( have_posts() ) : ?>
        <?php while ( have_posts() ) : the_post(); ?>
        
      
        <div class="entry">
            <div <?php post_class('single clear'); ?> id="post_<?php the_ID(); ?>">
                
                <div class="post-content"><?php the_content(); ?></div>
                <div class="post-footer"><?php the_tags(__('<strong>Tags: </strong>','templatic'), ', '); ?></div>
            </div>
        </div>

        <?php endwhile; ?>
    <?php endif; ?>
    
    
	 <?php
			if($_REQUEST['msg'] == 'success')
			{
			?>
			<p class="success_msg">Gracias por su mensaje.</p>
			<?php
			}
			?>
			 
			<form action="<?php echo get_permalink($post->ID);?>" method="post" id="contact_frm" name="contact_frm" class="wpcf7-form">
            <input type="hidden" name="request_url" value="<?php echo $_SERVER['REQUEST_URI'];?>" />

            <div class="form_row "> <label> Nombre <span class="indicates">*</span></label>
   				<input type="text" name="your-name" id="your-name" value="" class="textfield" size="40" />
				<span id="your_name_Info" class="error"></span>
		   </div>
           
            <div class="form_row ">
		    <label>Correo  <span class="indicates">*</span></label>
  				<input type="text" name="your-email" id="your-email" value="" class="textfield" size="40" /> 
				<span id="your_emailInfo"  class="error"></span>
		  </div>
                  
               <div class="form_row ">
                <label>Asunto <span class="indicates">*</span></label>
                <input type="text" name="your-subject" id="your-subject" value="" size="40" class="textfield" />
				<span id="your_subjectInfo" class="error"></span>
				</div>     
                  
           
            <div class="form_row">
             <label>Mensaje <span class="indicates">*</span></label>
             <textarea name="your-message" id="your-message" cols="40" class="textarea textarea2" rows="10"></textarea> 
			<span id="your_messageInfo"  class="error"></span>
			</div>
                <input type="submit" value="Enviar" class="b_submit" />  
          </form> 
          
 
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/contact_us_validation.js"></script>   
    

 


	<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Page Content Below')){?>
            <!--  <div class="allinone"> </div> all in one #end --> 
        <?php } else {?>  <?php }?>